package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.AppDynamicMsg;
import com.ruoyi.system.mapper.AppDynamicMsgMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppUserLoginMapper;
import com.ruoyi.system.domain.AppUserLogin;
import com.ruoyi.system.service.IAppUserLoginService;

/**
 * app用户登录日志Service业务层处理
 *
 * @author ruoyi
 * @date 2023-03-02
 */
@Service
public class AppUserLoginServiceImpl extends ServiceImpl<AppUserLoginMapper, AppUserLogin> implements IAppUserLoginService {
    @Autowired
    private AppUserLoginMapper appUserLoginMapper;

    /**
     * 查询app用户登录日志
     *
     * @param userId app用户登录日志主键
     * @return app用户登录日志
     */
    @Override
    public AppUserLogin selectAppUserLoginByUserId(Long userId) {
        return appUserLoginMapper.selectAppUserLoginByUserId(userId);
    }

    /**
     * 查询app用户登录日志列表
     *
     * @param appUserLogin app用户登录日志
     * @return app用户登录日志
     */
    @Override
    public List<AppUserLogin> selectAppUserLoginList(AppUserLogin appUserLogin) {
        return appUserLoginMapper.selectAppUserLoginList(appUserLogin);
    }

    /**
     * 新增app用户登录日志
     *
     * @param appUserLogin app用户登录日志
     * @return 结果
     */
    @Override
    public int insertAppUserLogin(AppUserLogin appUserLogin) {
        appUserLogin.setCreateTime(DateUtils.getNowDate());
        return appUserLoginMapper.insertAppUserLogin(appUserLogin);
    }

    /**
     * 修改app用户登录日志
     *
     * @param appUserLogin app用户登录日志
     * @return 结果
     */
    @Override
    public int updateAppUserLogin(AppUserLogin appUserLogin) {
        return appUserLoginMapper.updateAppUserLogin(appUserLogin);
    }

    /**
     * 批量删除app用户登录日志
     *
     * @param userIds 需要删除的app用户登录日志主键
     * @return 结果
     */
    @Override
    public int deleteAppUserLoginByUserIds(Long[] userIds) {
        return appUserLoginMapper.deleteAppUserLoginByUserIds(userIds);
    }

    /**
     * 删除app用户登录日志信息
     *
     * @param userId app用户登录日志主键
     * @return 结果
     */
    @Override
    public int deleteAppUserLoginByUserId(Long userId) {
        return appUserLoginMapper.deleteAppUserLoginByUserId(userId);
    }
}
